/*
 * Macro.h
 *
 *  Created on: 2014. 6. 10.
 *      Author: jjaehuny
 */

#ifndef FRAMEWORK_MACRO_H_
#define FRAMEWORK_MACRO_H_

#include <glog/logging.h>

#define LOG_INFO_PRETTY_FUNCTION(log)	\
	LOG(INFO) << __PRETTY_FUNCTION__ << "  log : " << log

#define SETVAR(type, name)	\
	private:	\
		type name;	\
	public:	\
		void set_##name(const type & newval) { name = newval; }

#define GETVAR(type, name)	\
	private:	\
		type name;	\
	public:	\
		const type & get_##name() const { return name; }

#define GETSETVAR(type, name)	\
	private:	\
		type name;	\
	public:	\
		const type & get_##name() const { return name; }	\
		void set_##name(const type & newval) { name = newval; }



#define GETVAR_PTR(type, name)	\
	private:	\
		type * name;	\
	public:	\
		type * get_##name() const { return name; }	\

#define SETVAR_PTR(type, name)	\
	private:	\
		type * name;	\
	public:	\
		void set_##name(type * newval) { name = newval; }

#define GETSETVAR_PTR(type, name)	\
	private:	\
		type * name;	\
	public:	\
		type * get_##name() const { return name; }	\
		void set_##name(type * newval) { name = newval; }


#define SAFE_DELETE(type) if (NULL != type) { delete type; type = NULL; }

#endif /* FRAMEWORK_MACRO_H_ */
